/**
 * ADPCM-DVI4 (RFC3551:4.5.1)
 */
#ifndef _ADPCM_H
#define _ADPCM_H

#include <stdint.h>

typedef unsigned int uint;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;

struct CodecState {
	// 前一个采用点值：adpcm算法是根据前一个采样点为基准值，求后续压缩值
	int valprev;
	// current index into stepsize table
	int index;
};

void decode(struct CodecState* state, uint8_t* input, int numSamples, s16* output);
void encode(struct CodecState* state, s16* input, int numSamples, uint8_t* output);


#endif

